package com.drone.drone_server.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("drone")
public class Drone {
    @TableId(value = "drone_id", type = IdType.AUTO)
    private Integer droneId;

    @TableField("drone_name")
    private String droneName;

    @TableField("model")
    private String model;

    @TableField("status")
    private Status status;

    @TableField("register_time")
    private Date registerTime;

    @Getter
    public enum Status {
        idle("idle"),
        on_mission("on_mission"),
        needs_charge("needs_charge"),
        charging("charging"),
        maintenance("maintenance");

        @EnumValue
        private final String value;

        Status(String value) {
            this.value = value;
        }

    }
}